<template>
  <div class="login-container">
    <el-form>
      <h3 class="title">欢迎使用员工管理系统</h3>
      <el-form-item>
        <el-input name="username"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input name="password"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button>登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  import axios from 'axios'

  export default {
    name: "login",
    data() {
      return {
      }
    },
    methods: {
      login() {
        axios.post('/api/login/login.html',{
          username: this.username,
          password: this.password
        })
          .then((res) => {
            res = res.data
            if (res.code > 0) {
              this.$router.push('/')
            } else {
              this.showTishi = true
              this.tishi = res.msg
            }
          })
          .catch((err) => {
            console.log(err);
          });
      },
    }
  }
</script>

<style scoped>
  .login-container{
    position: fixed;
    height: 100%;
    width:100%;
    margin: 0 20px;
  }
</style>
